package com.lzj.jiangxindaojia.view.login;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.lzj.jiangxindaojia.R;
import com.lzj.jiangxindaojia.http.HttpConstans;

import static com.lzj.jiangxindaojia.R.mipmap.back;

/**
 * Created by lizj on 2017/12/26.
 */

public class TiaoKuanActivity extends Activity implements View.OnClickListener{
    private TextView tv_tile;
    private ImageView iv_left;
    private LinearLayout ll_left;
    WebView  webView;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        this.tv_tile = ((TextView) findViewById(R.id.tv_tile));
        this.iv_left = ((ImageView) findViewById(R.id.iv_left));
        this.ll_left = ((LinearLayout) findViewById(R.id.ll_left));
        this.tv_tile.setText("");
        iv_left.setImageResource(back);
        this.ll_left.setVisibility(View.VISIBLE);
        ll_left.setOnClickListener(this);
        tv_tile.setText("匠心到家服务条款");
        String url = "http://test.zbtc.jiangxindaojia.com/#agreement?channel_number="+ HttpConstans.qdnumber;
        webView = (WebView) findViewById(R.id.webview);
        webView.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.loadUrl(url);
                return true;
            }

        });
        webView.loadUrl(url);
    }


    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.ll_left:
                finish();
                break;
        }
    }
}
